﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoolCode.Entities;
using CoolCode.Services;
using CoolCode.Web;
using CoolCode.Linq;
using CoolCode.WebServices;

namespace CoolCode.Web.UI.Views.Inquiry
{
    public partial class ProductsByMonth : System.Web.UI.Page
    {
        private IInspectionService _Service;
        public IInspectionService Service
        {
            get
            {
                if (_Service == null)
                {
                    _Service = ServiceFactory.Produce<IInspectionService>();
                }
                return _Service;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            handleEvents();
            if (!IsPostBack)
            {
                
            }
        }

        protected void handleEvents()
        {
            lnkSearch.Click += new EventHandler(lnkSearch_Click);
        }

        protected  void lnkSearch_Click(object sender, EventArgs e)
        {
            var list = this.Service.Statistics(2009); 
            gvMaster.DataSource = list;
            gvMaster.DataBind();
            udpHeader.Update();
        }
    }
}
